package com.woniu.orderservice.service.impl;

import com.woniu.orderservice.entity.Applications;
import com.woniu.orderservice.dao.ApplicationsDao;
import com.woniu.orderservice.service.ApplicationsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("applicationsService")
public class ApplicationsServiceImpl implements ApplicationsService {
    @Resource
    private ApplicationsDao applicationsDao;

    @Override
    public Applications queryById(Integer id) {
        return applicationsDao.queryById(id);
    }

    @Override
    public List<Applications> queryAllByLimit(int offset, int limit) {
        return applicationsDao.queryAllByLimit(offset, limit);
    }
   
     @Override
    public List<Applications> findAll() {
        return applicationsDao.findAll();
    }

    @Override
    public Applications insert(Applications applications) {
        applicationsDao.insert(applications);
        return applications;
    }

    @Override
    public Applications update(Applications applications) {
        applicationsDao.update(applications);
        return queryById(applications.getId());
    }

    @Override
    public boolean deleteById(Integer id) {
        return applicationsDao.deleteById(id) > 0;
    }
}